package com.king.springcloud.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.king.springcloud.dao.StorageDao;
import com.king.springcloud.domain.CommonResult;
import com.king.springcloud.service.StorageService;

import javax.annotation.Resource;

/**
 * @author king
 * @date 2020/10/20 19:41
 */
@Slf4j
@Service
public class OrderServiceImpl implements StorageService {

    @Resource
    private StorageDao storageDao;

    @Override
    public CommonResult decrease(Long productId, Integer count) {
        storageDao.decrease(productId, count);
        return new CommonResult(200, "减库存成功");
    }
}
